datum
	chemical_reaction
		slime/New()
			var/list/cores = typesof(/obj/item/slime_extract) - /obj/item/slime_extract/grey
			//The above are the colors of slime cores that the reaction can take place in. Added for totally random goostuffs.
			var/reactor = pick(cores)
			cores -= reactor
			required_container = reactor
			//Sure it only means a small amount of reactions but hey, SCIENCE!
//Grey
		slimespawn
			name = "Slime Spawn"
			id = "m_spawn"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_container = /obj/item/slime_extract/grey
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red Infused with plasma, the core begins to quiver and grow, and soon a new baby slime emerges from it!"), 1)
				var/mob/living/carbon/slime/S = new /mob/living/carbon/slime
				S.loc = get_turf_loc(holder.my_atom)


		slimemonkey
			name = "Slime Monkey"
			id = "m_monkey"
			result = null
			required_reagents = list("blood" = 5)
			result_amount = 1
			required_container = /obj/item/slime_extract/grey
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/i = 1, i <= 3, i++)
					var /mob/living/carbon/monkey/M = new /mob/living/carbon/monkey
					M.loc = get_turf_loc(holder.my_atom)

//Green
		slime/mutate
			name = "Mutation Toxin"
			id = "mutationtoxin"
			result = "mutationtoxin"
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

//Metal
		slime/metal
			name = "Slime Metal"
			id = "m_metal"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal
				M.amount = 20
				M.loc = get_turf_loc(holder.my_atom)
				var/obj/item/stack/sheet/plasteel/P = new /obj/item/stack/sheet/plasteel
				P.amount = 10
				P.loc = get_turf_loc(holder.my_atom)

//Gold
		slime/crit
			name = "Slime Crit"
			id = "m_tele"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red The slime extract begins to vibrate violently !"), 1)
				sleep(50)

				var/blocked = list(/mob/living/simple_animal/hostile,
					/mob/living/simple_animal/hostile/alien/queen/large,
					/mob/living/simple_animal/hostile/retaliate,
					/mob/living/simple_animal/hostile/retaliate/clown
					)//exclusion list for things you don't want the reaction to create.
				var/list/critters = typesof(/mob/living/simple_animal/hostile) - blocked // list of possible hostile mobs

				var/message = "A gold slime reaction has occured"

				var/atom/A = holder.my_atom
				if(A)
					var/turf/T = get_turf(A)
					var/area/my_area = get_area(T)
					message += " in [my_area.name]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</A>)"
					message += " (<A HREF='?_src_=vars;Vars=\ref[A]'>VV</A>)"

					var/mob/M = get(A, /mob)
					if(M)
						message += " - Carried By: [M.real_name] ([M.key]) (<A HREF='?_src_=holder;adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>)"
					else
						message += " - Last Fingerprint: [(A.fingerprintslast ? A.fingerprintslast : "N/A")]"
				else
					message += "."

				message_admins(message, 0, 1)

				playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)

				for(var/mob/living/carbon/human/M in viewers(get_turf_loc(holder.my_atom), null))
					if(M:eyecheck() <= 0)
						flick("e_flash", M.flash)

				for(var/i = 1, i <= 5, i++)
					var/chosen = pick(critters)
					var/mob/living/simple_animal/hostile/C = new chosen
					C.faction = "slimesummon"
					C.loc = get_turf_loc(holder.my_atom)
					if(prob(50))
						for(var/j = 1, j <= rand(1, 3), j++)
							step(C, pick(NORTH,SOUTH,EAST,WEST))

		slime/critlesser
			name = "Slime Crit Lesser"
			id = "m_tele3"
			result = null
			required_reagents = list("blood" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red The slime extract begins to vibrate violently !"), 1)
				sleep(50)

				var/blocked = list(/mob/living/simple_animal/hostile,
					/mob/living/simple_animal/hostile/alien/queen/large,
					/mob/living/simple_animal/hostile/retaliate,
					/mob/living/simple_animal/hostile/retaliate/clown
					)//exclusion list for things you don't want the reaction to create.
				var/list/critters = typesof(/mob/living/simple_animal/hostile) - blocked // list of possible hostile mobs

				var/message = "A gold slime reaction has occured"

				var/atom/A = holder.my_atom
				if(A)
					var/turf/T = get_turf(A)
					var/area/my_area = get_area(T)
					message += " in [my_area.name]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</A>)"
					message += " (<A HREF='?_src_=vars;Vars=\ref[A]'>VV</A>)"

					var/mob/M = get(A, /mob)
					if(M)
						message += " - Carried By: [M.real_name] ([M.key]) (<A HREF='?_src_=holder;adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>)"
					else
						message += " - Last Fingerprint: [(A.fingerprintslast ? A.fingerprintslast : "N/A")]"
				else
					message += "."

				message_admins(message, 0, 1)

				playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)

				for(var/mob/living/carbon/human/M in viewers(get_turf_loc(holder.my_atom), null))
					if(M:eyecheck() <= 0)
						flick("e_flash", M.flash)

				var/chosen = pick(critters)
				var/mob/living/simple_animal/hostile/C = new chosen
				C.faction = "neutral"
				C.loc = get_turf_loc(holder.my_atom)

//Silver
		slime/bork
			name = "Slime Bork"
			id = "m_tele2"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)

				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

				var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/snacks) - /obj/item/weapon/reagent_containers/food/snacks
				// BORK BORK BORK

				playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)

				for(var/mob/living/carbon/human/M in viewers(get_turf_loc(holder.my_atom), null))
					if(M:eyecheck() <= 0)
						flick("e_flash", M.flash)

				for(var/i = 1, i <= 4 + rand(4,8), i++)
					var/chosen = pick(borks)
					var/obj/B = new chosen
					if(B)
						B.loc = get_turf_loc(holder.my_atom)
						if(prob(50))
							for(var/j = 1, j <= rand(1, 3), j++)
								step(B, pick(NORTH,SOUTH,EAST,WEST))


		slime/bork2
			name = "Slime Bork 2"
			id = "m_tele4"
			result = null
			required_reagents = list("water" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)

				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

				var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/drinks) - /obj/item/weapon/reagent_containers/food/drinks
				// BORK BORK BORK

				playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)

				for(var/mob/living/carbon/human/M in viewers(get_turf_loc(holder.my_atom), null))
					if(M:eyecheck() <= 0)
						flick("e_flash", M.flash)

				for(var/i = 1, i <= 4 + rand(4,8), i++)
					var/chosen = pick(borks)
					var/obj/B = new chosen
					if(B)
						B.loc = get_turf_loc(holder.my_atom)
						if(prob(50))
							for(var/j = 1, j <= rand(1, 3), j++)
								step(B, pick(NORTH,SOUTH,EAST,WEST))


//Blue
		slime/frost
			name = "Slime Frost Oil"
			id = "m_frostoil"
			result = "frostoil"
			required_reagents = list("plasma" = 5)
			result_amount = 40
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

//Dark Blue
		slime/freeze
			name = "Slime Freeze"
			id = "m_freeze"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red The slime extract begins to vibrate violently !"), 1)
				sleep(50)
				playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
				for(var/mob/living/M in range (get_turf_loc(holder.my_atom), 7))
					M.adjustFireLoss(60)
					M.Stun(20)
					M << "\blue You feel a freezing cold chill!"

//Orange
		slime/casp
			name = "Slime Capsaicin Oil"
			id = "m_capsaicinoil"
			result = "capsaicin"
			required_reagents = list("blood" = 5)
			result_amount = 40
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

//Yellow
		slime/overload
			name = "Slime EMP"
			id = "m_emp"
			result = null
			required_reagents = list("blood" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder, var/created_volume)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				empulse(get_turf_loc(holder.my_atom), 3, 7)


		slime/cell
			name = "Slime Powercell"
			id = "m_cell"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder, var/created_volume)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/weapon/cell/slime/P = new /obj/item/weapon/cell/slime
				P.loc = get_turf_loc(holder.my_atom)

		slime/glow
			name = "Slime Glow"
			id = "m_glow"
			result = null
			required_reagents = list("water" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red The slime begins to emit a soft light. Squeezing it will cause it to glow brightly."), 1)
				var/obj/item/device/flashlight/slime/F = new /obj/item/device/flashlight/slime
				F.loc = get_turf_loc(holder.my_atom)

//Purple

		slime/psteroid
			name = "Slime Steroid"
			id = "m_steroid"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/weapon/slimesteroid/P = new /obj/item/weapon/slimesteroid
				P.loc = get_turf_loc(holder.my_atom)

		slime/jam
			name = "Slime Jam"
			id = "m_jam"
			result = "slimejelly"
			required_reagents = list("sugar" = 5)
			result_amount = 10
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")


//Dark Purple
		slime/plasma
			name = "Slime Plasma"
			id = "m_plasma"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/stack/sheet/mineral/plasma/P = new /obj/item/stack/sheet/mineral/plasma
				P.amount = 20
				P.loc = get_turf_loc(holder.my_atom)

//Red
		slime/glycerol
			name = "Slime Glycerol"
			id = "m_glycerol"
			result = "glycerol"
			required_reagents = list("plasma" = 5)
			result_amount = 8
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")


		slime/bloodlust
			name = "Bloodlust"
			id = "m_bloodlust"
			result = null
			required_reagents = list("blood" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/living/carbon/slime/slime in viewers(get_turf_loc(holder.my_atom), null))
					slime.tame = 0
					slime.rabid = 1
					for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
						O.show_message(text("\red The [slime] is driven into a frenzy!."), 1)

//Pink
		slime/ppotion
			name = "Slime Potion"
			id = "m_potion"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/weapon/slimepotion/P = new /obj/item/weapon/slimepotion
				P.loc = get_turf_loc(holder.my_atom)


//Black
		slime/mutate2
			name = "Advanced Mutation Toxin"
			id = "mutationtoxin2"
			result = "amutationtoxin"
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

//Oil
		slime/explosion
			name = "Slime Explosion"
			id = "m_explosion"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				for(var/mob/O in viewers(get_turf_loc(holder.my_atom), null))
					O.show_message(text("\red The slime extract begins to vibrate violently !"), 1)
				sleep(60)
				explosion(get_turf_loc(holder.my_atom), 1 ,3, 6)
//Light Pink
		slime/potion2
			name = "Slime Potion 2"
			id = "m_potion2"
			result = null
			result_amount = 1
			required_reagents = list("plasma" = 5)
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/weapon/slimepotion2/P = new /obj/item/weapon/slimepotion2
				P.loc = get_turf_loc(holder.my_atom)
//Adamantine
		slime/golem
			name = "Slime Golem"
			id = "m_golem"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/effect/golemrune/Z = new /obj/effect/golemrune
				Z.loc = get_turf_loc(holder.my_atom)
				Z.announce_to_ghosts()


//Bluespace
		slime/teleport
			name = "Slime Teleport"
			id = "m_tele"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder, var/created_volume)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")

				// Calculate new position (searches through beacons in world)
				var/obj/item/device/radio/beacon/chosen
				var/list/possible = list()
				for(var/obj/item/device/radio/beacon/W in world)
					possible += W

				if(possible.len > 0)
					chosen = pick(possible)

				if(chosen)
				// Calculate previous position for transition

					var/turf/FROM = get_turf_loc(holder.my_atom) // the turf of origin we're travelling FROM
					var/turf/TO = get_turf_loc(chosen)			 // the turf of origin we're travelling TO

					playsound(TO, 'sound/effects/phasein.ogg', 100, 1)

					var/list/flashers = list()
					for(var/mob/living/carbon/human/M in viewers(TO, null))
						if(M:eyecheck() <= 0)
							flick("e_flash", M.flash) // flash dose faggots
							flashers += M

					var/y_distance = TO.y - FROM.y
					var/x_distance = TO.x - FROM.x
					for (var/atom/movable/A in range(4, FROM )) // iterate thru list of mobs in the area
						if(istype(A, /obj/item/device/radio/beacon)) continue // don't teleport beacons because that's just insanely stupid
						if(A.anchored) continue
						if(istype(A, /obj/structure/cable )) continue

						var/turf/newloc = locate(A.x + x_distance, A.y + y_distance, TO.z) // calculate the new place
						if(!A.Move(newloc)) // if the atom, for some reason, can't move, FORCE them to move! :) We try Move() first to invoke any movement-related checks the atom needs to perform after moving
							A.loc = locate(A.x + x_distance, A.y + y_distance, TO.z)

						spawn()
							if(ismob(A) && !(A in flashers)) // don't flash if we're already doing an effect
								var/mob/M = A
								if(M.client)
									var/obj/blueeffect = new /obj(src)
									blueeffect.screen_loc = "WEST,SOUTH to EAST,NORTH"
									blueeffect.icon = 'icons/effects/effects.dmi'
									blueeffect.icon_state = "shieldsparkles"
									blueeffect.layer = 17
									blueeffect.mouse_opacity = 0
									M.client.screen += blueeffect
									sleep(20)
									M.client.screen -= blueeffect
									del(blueeffect)

//Cerulean

		slime/psteroid2
			name = "Slime Steroid 2"
			id = "m_steroid2"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/weapon/slimesteroid2/P = new /obj/item/weapon/slimesteroid2
				P.loc = get_turf_loc(holder.my_atom)

//Sepia
		slime/camera
			name = "Slime Camera"
			id = "m_camera"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/device/camera/P = new /obj/item/device/camera
				P.loc = get_turf_loc(holder.my_atom)

		slime/film
			name = "Slime Film"
			id = "m_film"
			result = null
			required_reagents = list("blood" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/obj/item/device/camera_film/P = new /obj/item/device/camera_film
				P.loc = get_turf_loc(holder.my_atom)


//Pyrite

		slime/paint
			name = "Slime Paint"
			id = "s_paint"
			result = null
			required_reagents = list("plasma" = 5)
			result_amount = 1
			required_other = 1
			on_reaction(var/datum/reagents/holder)
				feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
				var/list/paints = typesof(/obj/item/weapon/paint) - /obj/item/weapon/paint
				var/chosen = pick(paints)
				var/obj/P = new chosen
				if(P)
					P.loc = get_turf_loc(holder.my_atom)